home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / netmail / gigo0524.zip / COMPRESS.DOC < prev    next >
Text File  |  1994-04-26  |  8KB  |  178 lines

  1. COMPRESS 1 local
  2.  
  3. NAME compress, uncompress, zcat - compress and expand data
  4.  
  5. SYNOPSIS
  6.  
  7.      compress [-cCdDf?hkKvV][-b maxbits][-Iinpath][-Ooutpath][filenames...]
  8.      uncompress [-fCcvVkK?h][-Iinpath][-Ooutpath][filenames...]
  9.      zcat [-CvV?h][-Iinpath][-Ooutpath][filenames...]
  10.  
  11.      Argument Processing..case is significant:
  12.      MUST use '-' for switch character, all flags are optional.
  13.  
  14.      [options]
  15.      -V => print Version
  16.      -d => do_decomp default = off
  17.      -m => add "#! cunbatch\n" to top of file when compressing
  18.            (see MODIFICATIONS, below)
  19.      -v => verbose
  20.      -f => force overwrite of output file default = off
  21.      -n => no header: useful to uncompress old files
  22.      -c => cat all output to stdout default = off
  23.      -C => generate output compatible with compress 2.0
  24.      -k => %s input file, default = keep
  25.      -K => %s output file on error, default = kill
  26.      -b maxbits  => default = 16  bits
  27.      -I pathname => infile path  = none
  28.      -O pathname => outfile path = none
  29.      -Tn => Give up some CPU time (delay between writes)
  30.             (see MODIFICATIONS, below)
  31.      -? -h => help, print full usage message
  32.  
  33. DESCRIPTION
  34.  
  35. This manual refers to compress v4.10 don release. The compression and
  36. decompression routines are modified from the current version 4.0 joe release.
  37. However, the compressed output is cross compatible.
  38.  
  39. Compress reduces the size of the named files using adaptive Lempel-Ziv coding.
  40. Whenever possible, each file is replaced by one with the extension .Z,
  41. while keeping the same ownership modes, access and modification times.
  42. If no files are specified, the standard input is compressed to the
  43. standard output.Compressed files can be restored to their original form using
  44. uncompress or zcat.
  45.  
  46. The -f option will force compression of name. This is useful for compressing
  47. an entire directory, even if some of the files do not actually shrink.
  48. If -f is not given and compress is run in the foreground,
  49. the user is prompted as to whether an existing file should be overwritten.
  50.  
  51. The -c option makes compress/uncompress write to the standard output;
  52. no files are changed.  The nondestructive behavior of zcat is identical to
  53. that of uncompress -c.
  54.  
  55. Compress uses the modified Lempel-Ziv algorithm popularized in
  56. "A Technique for High Performance Data Compression", Terry A. Welch,
  57. "IEEE Computer," vol. 17, no. 6 (June 1984), pp. 8-19.
  58. Common substrings in the file are first replaced by 9-bit codes 257 and up.
  59. When code 512 is reached, the algorithm switches to 10-bit codes and
  60. continues to use more bits until the limit specified by the -b
  61. flag is reached (default 16). Bits must be between 9 and 16.  The default
  62. can be changed in the source to allow compress to be run on a smaller machine.
  63.  
  64. After the bits limit is attained, compress periodically checks the compression
  65. ratio.  If it is increasing, compress continues to use the existing code
  66. dictionary.  However, if the compression ratio decreases, compress
  67. discards the table of substrings and rebuilds it from scratch.  This allows
  68. the algorithm to adapt to the next "block" of the file.
  69.  
  70. Note that the -b flag is omitted for uncompress, since the bits
  71. parameter specified during compression is encoded within the output,
  72. along with a magic number to ensure that neither decompression of random
  73. data nor recompression of compressed data is attempted.
  74.  
  75. The amount of compression obtained depends on the size of the input, the
  76. number of bits per code, and the distribution of common substrings.
  77. Typically, text such as source code or English is reduced by 50-60%.
  78. Compression is generally much better than that achieved by Huffman coding
  79. (as used in pack ), or adaptive Huffman coding ( compact ),
  80. and takes less time to compute.
  81.  
  82. Under the -v option, a message is printed yielding the percentage of
  83. reduction for each file compressed.
  84.  
  85. If the -V option is specified, the current version and compile options
  86. are printed on stderr.
  87.  
  88. MODIFICATIONS
  89.  
  90. "-m":  For the compress 4.30d.gigo version, the "-m" parameter has been 
  91. added.  This modification allows compress to automaticly skip over the 
  92. "#! cunbatch" line when decompressing; it also allows compress to 
  93. _create_ this line when compressing outbound news.  These modifications 
  94. were made so that the gateway software would not have to copy the 
  95. original files to temporary files (+/- the #! cunbatch line) before and 
  96. after compression, as this takes up a lot of time.
  97.  
  98. "-Tx":  This option is mainly for people who are running GIGO under 
  99. OS/2 or other tasking evironments, and getting nailed every time 
  100. COMPRESS runs.  This option tells COMPRESS to delay between writing 
  101. characters out to the file.  Valid options:
  102.      -T1 :  Windows/OS2 timeslice
  103.      -T2 :  Desqview/Topview
  104.      -T3 :  DOS int 28h
  105.      -T4..-T500000 : Internally loop number of times specified 
  106.             (does not attempt to give up time, but just tries 
  107.             to nail your file system less often).
  108. You will need to experiment to see which of these works best, for 
  109. _your_ needs.  You may find that -T3 is preferable, even though you are 
  110. running OS/2, simply so that it does not release _too much_ time.
  111.  
  112.  
  113. CAVEATS
  114.  
  115.  
  116. FILES
  117.  
  118.  
  119. RETURN VALUE
  120.  
  121. Exit status is normally 0;
  122. if the last file is larger after (attempted) compression, the status is 2;
  123. if an error occurs, exit status is 1.
  124.  
  125. SEE ALSO
  126.         pack(1), compact(1)
  127.  
  128. DIAGNOSTICS
  129.         Usage: compress [\-dfvcV] [\-b maxbits] [file ...]
  130.                 Invalid options were specified on the command line.
  131.         Missing maxbits
  132.                 Maxbits must follow -b.
  133.         file : not in compressed format
  134.                 The file specified to uncompress has not been compressed.
  135.         file : compressed with bits, can only handle yy bits
  136.                 File was compressed by a program that could deal with
  137.                 more bits than the compress code on this machine.
  138.                 Recompress the file with smaller bits.
  139.         file : already has .Z suffix -- no change
  140.                 The file is assumed to be already compressed.
  141.                 Rename the file and try again.
  142.         file : filename too long to tack on .Z
  143.                 The file cannot be compressed because its name is longer than
  144.                 12 characters.  Rename and try again.
  145.                 This message does not occur on BSD systems.
  146.         file already exists; do you wish to overwrite (y or n)?
  147.         Respond "y" if you want the output file to be replaced; "n" if not.
  148.         uncompress: corrupt input
  149.                 A SIGSEGV violation was detected which usually means that
  150.                 the input file has been corrupted.
  151.         Compression: "xx.xx%"
  152.                 Percentage of the input saved by compression.
  153.                 (Relevant only for -v.)
  154.         -- not a regular file: unchanged
  155.                 When the input file is not a regular file,
  156.                 (e.g. a directory), it is left unaltered.
  157.         -- has other links: unchanged
  158.                 The input file has links; it is left unchanged.  See
  159.                 ln "(1)" for more information.
  160.         -- file unchanged
  161.                 No savings is achieved by compression.  The input remains
  162.                 virgin.
  163.  
  164. BUGS
  165.  
  166. Although compressed files are compatible between machines with large memory,
  167. -b 12 should be used for file transfer to architectures with
  168. a small process data space (64KB or less, as exhibited by the DEC PDP
  169. series, the Intel 80286, etc.)
  170.  
  171. MISCELLANEOUS
  172.  
  173.  
  174. NOTES
  175.  
  176.  
  177.  
  178.